package com.hntech.spring.annotation;

import com.hntech.spring.annotation.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @Autho changqi.wu
 * @Date 路在脚下，使劲踩！
 */
@ComponentScan("com.hntech.spring.annotation")
@EnableAspectJAutoProxy
public class SpringInitAnnotation {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringInitAnnotation.class);
        UserService userservice = context.getBean(UserService.class);  //多实现，无法识别，报错
        userservice.login();
        System.out.println("userservice1");


    }

}
